package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsColumnConfigDevice;
import com.econ.powercloud.ems.dal.mapper.EmsColumnConfigDeviceMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author : zjf
 * @Description : emsColumnConfidDevice表对应 DAO
 * @Date : 2021/10/21 14:20
 * @Modified by : zjf
 */
@Repository
public class EmsColumnConfigDeviceDAO extends ServiceImpl<EmsColumnConfigDeviceMapper, EmsColumnConfigDevice> {

    /**
     * 根据report_id 与 report_type获取对应的数据
     * @param reportId
     * @param reportType
     */
    public List<EmsColumnConfigDevice> selectListByReportIdAndReportType(String reportId, String reportType){
        LambdaQueryWrapper<EmsColumnConfigDevice> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(EmsColumnConfigDevice::getReportId,reportId);
        lambdaQueryWrapper.eq(EmsColumnConfigDevice::getReportType,reportType);
        return this.baseMapper.selectList(lambdaQueryWrapper);
    }

    public List<EmsColumnConfigDevice> selectAll() {
        return this.baseMapper.selectAll();
    }
}
